package common

import (
	"path/filepath"
	"strings"
)

type FileInfo struct {
	Filename    string
	CurrentPath string
	Data        []byte
	SendToPath  string
	Size        int64
}

func (fi *FileInfo) IsEmpty() bool {
	return strings.TrimSpace(fi.Filename) == "" || strings.TrimSpace(fi.SendToPath) == ""
}

func (fi *FileInfo) GetFileUrl() string {
	return filepath.Join(fi.SendToPath, fi.Filename)
}
